package modelo.bo.cmd.login;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import modelo.bo.cmd.Acao;
import modelo.bo.session.SessionManager;

public class LogoffUsuario extends Acao {
	//private Login login;
	
	public LogoffUsuario() {
		//this.login = new Login();
	}
	
	@Override
	public void init(HttpServletRequest request) {
		super.pagina = "/pages/login/login-usuario.jsp";
	}

	@Override
	public boolean executar(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		HttpSession session = request.getSession(false);
		SessionManager.encerrarSessionAtual(session, "login");
		
		return false;
	}

	@Override
	public String retornaPagina() {
		return super.pagina;
	}

}
